from selenium.webdriver.common.by import By

"""
    商品列表
    page_goods_
"""
# iframe--1
page_left_iframe = [By.XPATH, "//iframe[1]"]  # id="multitabs_main_0“
# 右侧列表iframe--2
page_right_iframe = [By.XPATH, "//iframe[contains(@id,'multitabs_info')]"]  # id="multitabs_info_L3RoLWF”
# spu添加表单iframe--3
page_add_spu_iframe = [By.XPATH, "//iframe[contains(@src,'edit/goods')]"]  # frameborder="0"
# 素材库iframe--4
page_stock_library_iframe = [By.XPATH, "//iframe[contains(@src,'stock-library')]"]
# 添加商品-按钮
page_goods_add_goods_btn = [By.ID, "btn_add"]
# 添加商品-商品名称SPU
page_goods_goods_name = [By.ID, "goodsName"]
# 添加商品-商品副标题
page_goods_goods_sec_name = [By.ID, "goodsSecName"]
# 商品分类列表
page_goods_category_list = [By.XPATH, "//div[@class='form-group col-md-6']//label[contains(text(),'商品分类')]/..//div"]
# 排序值
page_goods_sort = [By.ID, "sort"]
# 限购数量
page_goods_limit_num = [By.ID, "limitNum"]
# 快递运费
page_goods_express_amount = [By.ID, "expressAmount"]
# 商品标签
page_goods_tags = [By.XPATH, "//label[contains(text(),'商品标签')]/..//div//input"]
# 规格名称-预置规格
page_goods_pre_specs = [By.XPATH, "//label[contains(text(),'规格名称')]/..//div//div//div[@class='dropdown']"]
# 商品图片上传
page_goods_page = [By.XPATH, "//label[contains(text(),'商品图片')]/..//a[@title='新增']"]
# 图片确定按钮
page_goods_page_save_btn = [By.XPATH, "//button[text()='确认']"]
# 商品视频上传
page_goods_view = [By.XPATH, "//label[contains(text(),'商品视频')]/..//a[@title='新增']"]
# 商品介绍
page_goods_description = [By.ID, "w-e-textarea-1"]
# 保存按钮
page_goods_save_btn = [By.XPATH, "//a[text()='保存']"]
# 添加成功预期值
page_goods_add_suc_exp = [By.XPATH, "//span[contains(text(),'保存成功')]"]
# 商品图片为空-提示
page_goods_page_empty = [By.XPATH, "//span[contains(text(),'商品图片不能为空')]"]

"""
    商品列表-查询页
    page_goods_select_
"""
# 商品名称
page_goods_select_goodsName = [By.ID, "goodsName"]
# 查询按钮
page_goods_select_btn_search = [By.XPATH, "//button[@id='btn_search']"]
"""
    商品列表-
    page_goods_list_
"""
# 第一条商品下架状态
page_goods_list_status = [By.XPATH, "//td//span[text()='下架']"]
# 上下架-确认按钮
page_goods_list_status_btn_true = [By.XPATH, "//div[@class='jconfirm-buttons']//button[text()='确认']"]

# 无SKU上架提示：商品没有sku信息不能上架
page_goods_list_no_sku_up = [By.XPATH, "//span[contains(text(),'不能上架')]"]
"""
    商品SKU-添加页
    page_sku_
"""
# 点击编辑sku按钮
page_sku_add_btn = [By.XPATH, "//a[text()='编辑SKU']"]
# sku添加表单iframe
page_sku_add_iframe = [By.XPATH, "//iframe[contains(@src,'edit/goodsDetail')]"]
# sku-点击创建全部规格按钮
page_sku_add_all_size = [By.XPATH, "//button[@onclick='addAllGoodsDetail()']"]
# sku规格数量
page_sku_add_size_amount = [By.XPATH, "//tbody[@id='goods-detail-tb-body']/tr"]
# 保存按钮
page_sku_save_btn = [By.XPATH, "//div[@id='toolbar']/button[@onclick='save()']"]
# sku保存成功-提示信息
page_sku_add_suc_info = [By.XPATH, "//span[contains(text(),'保存成功')]"]
